.class public Lcom/k/j/o/a/c;
.super Ljava/io/InputStream;


# instance fields
.field private a:Ljava/io/InputStream;

.field private b:J

.field private c:J

.field private d:[B

.field private e:I


# direct methods
.method public constructor <init>(Ljava/io/File;)V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/FileNotFoundException;
        }
    .end annotation

    new-instance v0, Ljava/io/FileInputStream;

    invoke-direct {v0, p1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    invoke-direct {p0, v0}, Lcom/k/j/o/a/c;-><init>(Ljava/io/InputStream;)V

    return-void
.end method

.method public constructor <init>(Ljava/io/InputStream;)V
    .locals 2

    const-wide/16 v0, 0x0

    invoke-direct {p0, p1, v0, v1}, Lcom/k/j/o/a/c;-><init>(Ljava/io/InputStream;J)V

    return-void
.end method

.method public constructor <init>(Ljava/io/InputStream;J)V
    .locals 2

    invoke-direct {p0}, Ljava/io/InputStream;-><init>()V

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/k/j/o/a/c;->b:J

    const-wide/16 v0, -0x1

    iput-wide v0, p0, Lcom/k/j/o/a/c;->c:J

    iput-object p1, p0, Lcom/k/j/o/a/c;->a:Ljava/io/InputStream;

    iput-wide p2, p0, Lcom/k/j/o/a/c;->b:J

    return-void
.end method

.method private a([BII)V
    .locals 3

    iget-object v0, p0, Lcom/k/j/o/a/c;->d:[B

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/k/j/o/a/c;->d:[B

    array-length v0, v0

    const/4 v1, 0x1

    if-ge v0, v1, :cond_1

    :cond_0
    return-void

    :cond_1
    :goto_0
    if-ge p2, p3, :cond_0

    iget v0, p0, Lcom/k/j/o/a/c;->e:I

    iget-object v1, p0, Lcom/k/j/o/a/c;->d:[B

    array-length v1, v1

    if-lt v0, v1, :cond_2

    const/4 v0, 0x0

    iput v0, p0, Lcom/k/j/o/a/c;->e:I

    :cond_2
    aget-byte v0, p1, p2

    and-int/lit16 v0, v0, 0xff

    iget-object v1, p0, Lcom/k/j/o/a/c;->d:[B

    iget v2, p0, Lcom/k/j/o/a/c;->e:I

    aget-byte v1, v1, v2

    and-int/lit16 v1, v1, 0xff

    xor-int/2addr v0, v1

    and-int/lit16 v0, v0, 0xff

    int-to-byte v0, v0

    aput-byte v0, p1, p2

    add-int/lit8 p2, p2, 0x1

    iget v0, p0, Lcom/k/j/o/a/c;->e:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/k/j/o/a/c;->e:I

    goto :goto_0
.end method


# virtual methods
.method public a()J
    .locals 2

    iget-wide v0, p0, Lcom/k/j/o/a/c;->b:J

    return-wide v0
.end method

.method public a(J)V
    .locals 8
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    monitor-enter p0

    :try_start_0
    iget-wide v0, p0, Lcom/k/j/o/a/c;->b:J

    cmp-long v0, p1, v0

    if-gez v0, :cond_0

    new-instance v0, Ljava/io/IOException;

    const/16 v1, 0xab5

    const/16 v2, 0x15

    invoke-static {v1, v2}, Lcom/k/j/o/a/g;->a(II)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0

    :cond_0
    :try_start_1
    iget-wide v0, p0, Lcom/k/j/o/a/c;->b:J

    cmp-long v0, p1, v0

    if-nez v0, :cond_1

    monitor-exit p0

    :goto_0
    return-void

    :cond_1
    iget-wide v0, p0, Lcom/k/j/o/a/c;->b:J

    sub-long v0, p1, v0

    iget-object v2, p0, Lcom/k/j/o/a/c;->a:Ljava/io/InputStream;

    invoke-virtual {v2, v0, v1}, Ljava/io/InputStream;->skip(J)J

    move-result-wide v2

    cmp-long v4, v2, v0

    if-eqz v4, :cond_2

    new-instance v4, Ljava/io/IOException;

    const/16 v5, 0xaff

    const/16 v6, 0x12

    invoke-static {v5, v6}, Lcom/k/j/o/a/g;->a(II)Ljava/lang/String;

    move-result-object v5

    const/4 v6, 0x2

    new-array v6, v6, [Ljava/lang/Object;

    const/4 v7, 0x0

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v2

    aput-object v2, v6, v7

    const/4 v2, 0x1

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    aput-object v0, v6, v2

    invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v0

    invoke-direct {v4, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v4

    :cond_2
    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0
.end method

.method public a([B)V
    .locals 1

    iput-object p1, p0, Lcom/k/j/o/a/c;->d:[B

    const/4 v0, 0x0

    iput v0, p0, Lcom/k/j/o/a/c;->e:I

    return-void
.end method

.method public b()J
    .locals 2

    iget-wide v0, p0, Lcom/k/j/o/a/c;->c:J

    return-wide v0
.end method

.method public b(J)J
    .locals 2

    monitor-enter p0

    :try_start_0
    iput-wide p1, p0, Lcom/k/j/o/a/c;->c:J

    iget-wide v0, p0, Lcom/k/j/o/a/c;->c:J

    monitor-exit p0

    return-wide v0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method public c(J)J
    .locals 2

    monitor-enter p0

    const-wide/16 v0, 0x0

    cmp-long v0, p1, v0

    if-gez v0, :cond_0

    :try_start_0
    iput-wide p1, p0, Lcom/k/j/o/a/c;->c:J

    :goto_0
    iget-wide v0, p0, Lcom/k/j/o/a/c;->c:J

    monitor-exit p0

    return-wide v0

    :cond_0
    iget-wide v0, p0, Lcom/k/j/o/a/c;->b:J

    add-long/2addr v0, p1

    iput-wide v0, p0, Lcom/k/j/o/a/c;->c:J

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method public c()V
    .locals 1

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/k/j/o/a/c;->d:[B

    const/4 v0, 0x0

    iput v0, p0, Lcom/k/j/o/a/c;->e:I

    return-void
.end method

.method public close()V
    .locals 2

    monitor-enter p0

    :try_start_0
    iget-object v0, p0, Lcom/k/j/o/a/c;->a:Ljava/io/InputStream;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/k/j/o/a/c;->a:Ljava/io/InputStream;

    invoke-virtual {v0}, Ljava/io/InputStream;->close()V
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    :cond_0
    const/4 v0, 0x0

    :try_start_1
    iput-object v0, p0, Lcom/k/j/o/a/c;->a:Ljava/io/InputStream;

    :goto_0
    monitor-exit p0

    return-void

    :catch_0
    move-exception v0

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/k/j/o/a/c;->a:Ljava/io/InputStream;

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v0

    :catchall_1
    move-exception v0

    const/4 v1, 0x0

    :try_start_2
    iput-object v1, p0, Lcom/k/j/o/a/c;->a:Ljava/io/InputStream;

    throw v0
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0
.end method

.method public read()I
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x1

    new-array v0, v0, [B

    invoke-virtual {p0, v0}, Lcom/k/j/o/a/c;->read([B)I

    move-result v1

    if-gtz v1, :cond_0

    const/4 v0, -0x1

    :goto_0
    return v0

    :cond_0
    const/4 v1, 0x0

    aget-byte v0, v0, v1

    goto :goto_0
.end method

.method public read([B)I
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x0

    array-length v1, p1

    invoke-virtual {p0, p1, v0, v1}, Lcom/k/j/o/a/c;->read([BII)I

    move-result v0

    return v0
.end method

.method public read([BII)I
    .locals 5
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    monitor-enter p0

    :try_start_0
    iget-wide v0, p0, Lcom/k/j/o/a/c;->c:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-lez v0, :cond_3

    iget-wide v0, p0, Lcom/k/j/o/a/c;->c:J

    iget-wide v2, p0, Lcom/k/j/o/a/c;->b:J

    sub-long/2addr v0, v2

    long-to-int v0, v0

    :goto_0
    if-gtz v0, :cond_0

    const/4 v0, -0x1

    monitor-exit p0

    :goto_1
    return v0

    :cond_0
    if-le p3, v0, :cond_1

    move p3, v0

    :cond_1
    iget-object v0, p0, Lcom/k/j/o/a/c;->a:Ljava/io/InputStream;

    invoke-virtual {v0, p1, p2, p3}, Ljava/io/InputStream;->read([BII)I

    move-result v0

    if-lez v0, :cond_2

    iget-wide v1, p0, Lcom/k/j/o/a/c;->b:J

    int-to-long v3, v0

    add-long/2addr v1, v3

    iput-wide v1, p0, Lcom/k/j/o/a/c;->b:J

    invoke-direct {p0, p1, p2, v0}, Lcom/k/j/o/a/c;->a([BII)V

    :cond_2
    monitor-exit p0

    goto :goto_1

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0

    :cond_3
    move v0, p3

    goto :goto_0
.end method

.method public skip(J)J
    .locals 8
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const-wide/16 v0, 0x0

    monitor-enter p0

    :try_start_0
    sget-object v2, Ljava/lang/System;->out:Ljava/io/PrintStream;

    const/16 v3, 0xad7

    const/16 v4, 0x28

    invoke-static {v3, v4}, Lcom/k/j/o/a/g;->a(II)Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x3

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    invoke-static {p1, p2}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v6

    aput-object v6, v4, v5

    const/4 v5, 0x1

    iget-wide v6, p0, Lcom/k/j/o/a/c;->c:J

    invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v6

    aput-object v6, v4, v5

    const/4 v5, 0x2

    iget-wide v6, p0, Lcom/k/j/o/a/c;->b:J

    invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v6

    aput-object v6, v4, v5

    invoke-static {v3, v4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    iget-wide v2, p0, Lcom/k/j/o/a/c;->c:J

    cmp-long v2, v2, v0

    if-lez v2, :cond_5

    iget-wide v2, p0, Lcom/k/j/o/a/c;->c:J

    iget-wide v4, p0, Lcom/k/j/o/a/c;->b:J

    sub-long/2addr v2, v4

    :goto_0
    cmp-long v4, v2, v0

    if-gez v4, :cond_0

    new-instance v0, Ljava/io/IOException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const/16 v4, 0xaca

    const/16 v5, 0xd

    invoke-static {v4, v5}, Lcom/k/j/o/a/g;->a(II)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    :catchall_0
    move-exception v0

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0

    :cond_0
    cmp-long v4, p1, v2

    if-lez v4, :cond_1

    move-wide p1, v2

    :cond_1
    cmp-long v2, p1, v0

    if-nez v2, :cond_2

    :try_start_1
    monitor-exit p0

    :goto_1
    return-wide v0

    :cond_2
    iget-object v2, p0, Lcom/k/j/o/a/c;->a:Ljava/io/InputStream;

    invoke-virtual {v2, p1, p2}, Ljava/io/InputStream;->skip(J)J

    move-result-wide v2

    cmp-long v0, v2, v0

    if-ltz v0, :cond_3

    iget-wide v0, p0, Lcom/k/j/o/a/c;->b:J

    add-long/2addr v0, v2

    iput-wide v0, p0, Lcom/k/j/o/a/c;->b:J

    :cond_3
    iget-object v0, p0, Lcom/k/j/o/a/c;->d:[B

    if-eqz v0, :cond_4

    iget-object v0, p0, Lcom/k/j/o/a/c;->d:[B

    array-length v0, v0

    if-lez v0, :cond_4

    iget v0, p0, Lcom/k/j/o/a/c;->e:I

    long-to-int v1, v2

    add-int/2addr v0, v1

    iget-object v1, p0, Lcom/k/j/o/a/c;->d:[B

    array-length v1, v1

    rem-int/2addr v0, v1

    iput v0, p0, Lcom/k/j/o/a/c;->e:I

    :cond_4
    monitor-exit p0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-wide v0, v2

    goto :goto_1

    :cond_5
    move-wide v2, p1

    goto :goto_0
.end method
